The present invention relates generally to data recovery, and more particularly to a method and apparatus for using a flexible buffering scheme in an XOR engine to generate checksums in RAID systems, allowing a user to recover data when a disk drive partly or completely fails.